import './assets/main.css'

import { createApp } from 'vue'
import App from './App.vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import VueRouter from 'vue-router'
import Homepage from './components/Homepage.vue'
import RestaurantDetail from './components/RestaurantDetail.vue'
import UserInfo from './components/UserInfo.vue'

// import router from './router'
// import router from './router/index.js'

// 创建 Vue 应用实例
const app = createApp(App);

// 使用 Element Plus
app.use(ElementPlus);
// app.use(router)



//全局注册图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
}
// 使用 VueRouter
app.use(VueRouter)
const router = new VueRouter({
    routes: [
        { path: '/', component: Homepage },
        { path: '/Restaurant-detail', component: RestaurantDetail },
        { path: 'user-info', component: UserInfo },
    ]
})
// 挂载 Vue 应用到 DOM
app.mount('#app');


